Integrand size = 34, antiderivative size = 105 \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {\sqrt {2} \sqrt {a} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {2 A \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d} \]
[Out]
Time = 0.17 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3673, 3608, 3561, 212} \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {\sqrt {2} \sqrt {a} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {2 A \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d} \]
[In]
[Out]
Rule 212
Rule 3561
Rule 3608
Rule 3673
Rubi steps \begin{align*} \text {integral}& = -\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d}+\int \sqrt {a+i a \tan (c+d x)} (-B+A \tan (c+d x)) \, dx \\ & = \frac {2 A \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d}-(i A+B) \int \sqrt {a+i a \tan (c+d x)} \, dx \\ & = \frac {2 A \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d}-\frac {(2 a (A-i B)) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d} \\ & = -\frac {\sqrt {2} \sqrt {a} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {2 A \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d} \\ \end{align*}
Time = 0.70 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.88 \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\frac {-3 \sqrt {2} \sqrt {a} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )+2 \sqrt {a+i a \tan (c+d x)} (3 A-i B+B \tan (c+d x))}{3 d} \]
[In]
[Out]
Time = 0.13 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.78
method | result | size |
derivativedivides | \(\frac {-\frac {2 i B \left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+2 a A \sqrt {a +i a \tan \left (d x +c \right )}-a^{\frac {3}{2}} \left (-i B +A \right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{a d}\) | \(82\) |
default | \(\frac {-\frac {2 i B \left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+2 a A \sqrt {a +i a \tan \left (d x +c \right )}-a^{\frac {3}{2}} \left (-i B +A \right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{a d}\) | \(82\) |
parts | \(\frac {A \left (2 \sqrt {a +i a \tan \left (d x +c \right )}-\sqrt {a}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )\right )}{d}+\frac {2 i B \left (-\frac {\left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+\frac {a^{\frac {3}{2}} \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2}\right )}{d a}\) | \(113\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 332 vs. \(2 (80) = 160\).
Time = 0.26 (sec) , antiderivative size = 332, normalized size of antiderivative = 3.16 \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {3 \, \sqrt {2} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \log \left (-\frac {4 \, {\left ({\left (-i \, A - B\right )} a e^{\left (i \, d x + i \, c\right )} - {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - 3 \, \sqrt {2} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \log \left (-\frac {4 \, {\left ({\left (-i \, A - B\right )} a e^{\left (i \, d x + i \, c\right )} - {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - 4 \, \sqrt {2} {\left ({\left (3 \, A - 2 i \, B\right )} e^{\left (3 i \, d x + 3 i \, c\right )} + 3 \, A e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{6 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
[In]
[Out]
\[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\int \sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \left (A + B \tan {\left (c + d x \right )}\right ) \tan {\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.02 \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\frac {3 \, \sqrt {2} {\left (A - i \, B\right )} a^{\frac {5}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) - 4 i \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac {3}{2}} B a + 12 \, \sqrt {i \, a \tan \left (d x + c\right ) + a} A a^{2}}{6 \, a^{2} d} \]
[In]
[Out]
\[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} \sqrt {i \, a \tan \left (d x + c\right ) + a} \tan \left (d x + c\right ) \,d x } \]
[In]
[Out]
Time = 8.00 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.14 \[ \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\frac {2\,A\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{d}-\frac {B\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^{3/2}\,2{}\mathrm {i}}{3\,a\,d}+\frac {\sqrt {2}\,B\,\sqrt {-a}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{d}-\frac {\sqrt {2}\,A\,\sqrt {a}\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {a}}\right )}{d} \]
[In]
[Out]